home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Pdmod / modules / netinet / tcp.m < prev    next >
Encoding:
Text File  |  2002-10-28  |  3.5 KB  |  99 lines

  1. /*
  2.  * $Id: tcp.h,v 1.3 1993/06/30 05:45:25 jraja Exp $
  3.  *
  4.  * HISTORY
  5.  * $Log: tcp.h,v $
  6.  * Revision 1.3  1993/06/30  05:45:25  jraja
  7.  * Changed bitfield definitions to be more like ANSI-C.
  8.  *
  9.  * Revision 1.2  1993/03/03  21:27:41  jraja
  10.  * Added #ifdef to prevent multiple inclusion.
  11.  *
  12.  * Revision 1.1  92/11/17  16:30:05  16:30:05  jraja (Jarno Tapio Rajahalme)
  13.  * Initial revision
  14.  * 
  15.  *
  16.  */
  17.  
  18. /*
  19.  * Copyright (c) 1982, 1986 Regents of the University of California.
  20.  * All rights reserved.
  21.  *
  22.  * Redistribution and use in source and binary forms, with or without
  23.  * modification, are permitted provided that the following conditions
  24.  * are met:
  25.  * 1. Redistributions of source code must retain the above copyright
  26.  *    notice, this list of conditions and the following disclaimer.
  27.  * 2. Redistributions in binary form must reproduce the above copyright
  28.  *    notice, this list of conditions and the following disclaimer in the
  29.  *    documentation and/or other materials provided with the distribution.
  30.  * 3. All advertising materials mentioning features or use of this software
  31.  *    must display the following acknowledgement:
  32.  *      This product includes software developed by the University of
  33.  *      California, Berkeley and its contributors.
  34.  * 4. Neither the name of the University nor the names of its contributors
  35.  *    may be used to endorse or promote products derived from this software
  36.  *    without specific prior written permission.
  37.  *
  38.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  39.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  40.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  41.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  42.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  43.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  44.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  45.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  46.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  47.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  48.  * SUCH DAMAGE.
  49.  *
  50.  *      @(#)tcp.h       7.7 (Berkeley) 6/28/90
  51.  */
  52.  
  53. /*
  54.  * TCP header.
  55.  * Per RFC 793, September, 1981.
  56.  */
  57.  
  58. #define TH_FIN  $01
  59. #define TH_SYN  $02
  60. #define TH_RST  $04
  61. #define TH_PUSH $08
  62. #define TH_ACK  $10
  63. #define TH_URG  $20
  64.  
  65. OBJECT tcphdr
  66.     th_sport:UWORD,               /* source port */
  67.     th_dport:UWORD,               /* destination port */
  68.     th_seq:ULONG,                 /* sequence number */
  69.     th_ack:ULONG,                 /* acknowledgement number */
  70.     th_off:UBYTE,               /* data offset */
  71.     th_x2:UBYTE,                /* (unused) */
  72.     th_flags:UBYTE,
  73.     th_win:UWORD,                 /* window */
  74.     th_sum:UWORD,                 /* checksum */
  75.     th_urp:UWORD                 /* urgent pointer */
  76.  
  77.  
  78. #define TCPOPT_EOL      0
  79. #define TCPOPT_NOP      1
  80. #define TCPOPT_MAXSEG   2
  81.  
  82. /*
  83.  * Default maximum segment size for TCP.
  84.  * With an IP MSS of 576, this is 536,
  85.  * but 512 is probably more convenient.
  86.  * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
  87.  */
  88. #define TCP_MSS 512
  89.  
  90. #define TCP_MAXWIN      65535           /* largest value for window */
  91.  
  92. /*
  93.  * User-settable options (used with setsockopt).
  94.  */
  95. #define TCP_NODELAY     $01    /* don't delay send to coalesce packets */
  96. #define TCP_MAXSEG      $02    /* set maximum segment size */
  97.  
  98.  
  99.